home *** CD-ROM | disk | FTP | other *** search
- Path: kbad.eglin.af.mil!rpi!not-for-mail
- From: ivo.welch@AGSM.UCLA.EDU (Ivo Welch)
- Newsgroups: comp.lang.c++,comp.lang.c++.moderated
- Subject: Defining Classes and Class Functions extern: 2 Line Sample
- Date: 30 Jan 1996 21:26:15 -0000
- Organization: The Anderson School at UCLA
- Sender: cppmods@netlab.cs.rpi.edu
- Approved: vandevod@cs.rpi.edu
- Message-ID: <4em2dn$kio@netlab.cs.rpi.edu>
- NNTP-Posting-Host: netlab.cs.rpi.edu
- X-Original-Date: 30 Jan 1996 21:07:55 GMT
-
-
- Why does the following not work?
- class tryclass;
- extern int tryclass::tryclassfun(int w);
- The second line produces a syntax error on gcc. If it worked, one should
- then be able to do:
- extern tryclass *tryclass;
- tryclass->tryclassfun(1);
- The advantage would be that I would not have to have the code in one file
- see the entire class definition ==> effective data hiding.
-
- Is there an equivalent recommended way of hiding many member
- functions/declarations from a particular file? I believe there are
- languages that allow something like
- FROM tryclass IMPURT tryclassfun
- which is what I really am trying to duplicate here.
-
- Thanks for any help. Please respond to me---I will summarize.
-
- /ivo welch
-
- --
- Ivo Welch ivo.welch@anderson.ucla.edu
- Assoc Prof of Finance Anderson GSM at UCLA
- 110 Westwood Plaza, Box 951481, LA CA 90095-1481
-
- [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
- [ Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm ]
- [ Moderation policy: http://www.connobj.com/cpp/guide.htm ]
- [ Comments? mailto:c++-request@netlab.cs.rpi.edu ]
-